﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO {
    /// <summary>
    /// 拓垦多单结算
    /// </summary>
    [Serializable]
    public class token_check_out_model {
        /// <summary>
        /// 初始化
        /// </summary>
        public token_check_out_model() {
            orders = new List<token_order_model>();
            shipping = new Dictionary<long?, shippingaddress_dto>();
        }
        /// <summary>
        /// 购买来源 0立即购买 1购物车结算 2 集市购买
        /// </summary>
        public int source_type { get; set; }

        /// <summary>
        /// 订单列表
        /// </summary>
        public List<token_order_model> orders { get; set; }
        /// <summary>
        /// 客户端ip
        /// </summary>
        /// <value>The ip.</value>
        public string ip { get; set; }
        /// <summary>
        /// 微信OpenId
        /// </summary>
        public string wx_open_id { get; set; }
        /// <summary>
        /// 购买人Id
        /// </summary>
        public long buy_user_id { get; set; }
        /// <summary>
        /// 是否跨境商品
        /// </summary>
        public bool is_seas { get; set; }
        /// <summary>
        /// 订单总金额
        /// </summary>
        public decimal total_amount { get; set; }
        /// <summary>
        /// 当前用户总红砖数量
        /// </summary>
        public decimal total_red_drill { get; set; }
        /// <summary>
        /// 商品总红砖数量
        /// </summary>
        public decimal product_red_drill { get; set; }
        /// <summary>
        /// 会员收货地址Id
        /// </summary>
        public long? shipping_address_id { get; set; }
        /// <summary>
        /// 配送地址
        /// </summary>
        public Dictionary<long?, shippingaddress_dto> shipping;
        /// <summary>
        /// 是否全红砖兑换 0：不参与活动商品购买,1:全兑换，2：部分兑换
        /// </summary>
        public int is_all_drill { get; set; }
        /// <summary>
        /// 是否纯现金支付
        /// </summary>
        public bool is_cash_pay { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class token_order_model {
        /// <summary>
        /// 初始化
        /// </summary>
        public token_order_model() {
            order_items = new List<token_order_item_model>();
        }
        /// <summary>
        /// 待支付订单订单号 
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal freight { get; set; }
        /// <summary>
        /// 买家留言
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 总金额（价格 * 数量 + 邮费）
        /// </summary>
        public decimal total_amount { get; set; }
        /// <summary>
        /// 订单总红砖
        /// </summary>
        public decimal total_red_drill { get; set; }
        /// <summary>
        /// 是否跨境商品
        /// </summary>
        public bool is_seas { get; set; }
        /// <summary>
        /// 店铺id
        /// </summary>
        public long shop_id { get; set; }
        /// <summary>
        /// 店铺名称
        /// </summary>
        public string shop_name { get; set; }
        /// <summary>
        /// 店铺logo
        /// </summary>
        public string shop_logo { get; set; }
        /// <summary>
        /// 订单商品
        /// </summary>
        public List<token_order_item_model> order_items { get; set; }
    }
    /// <summary>
    /// 订单商品
    /// </summary>
    [Serializable]
    public class token_order_item_model {
        /// <summary>
        /// 产品Id
        /// </summary>
        public long product_id { get; set; }
        /// <summary>
        /// 分销商户编号
        /// </summary>
        public string share_no { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string product_name { get; set; }
        /// <summary>
        /// 商品图片
        /// </summary>
        public string product_main_img { get; set; }
        /// <summary>
        /// 销售价格
        /// </summary>
        public decimal price { get; set; }
        /// <summary>
        /// 活动价【仅供确认页面显示使用】
        /// </summary>
        public decimal activity_price { get; set; }
        /// <summary>
        /// 红砖数
        /// </summary>
        public decimal red_drill { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public int num { get; set; }
        /// <summary>
        /// 商品规格
        /// </summary>
        public long sku_id { get; set; }
        /// <summary>
        /// 规格名称
        /// </summary>
        public string sku_name { get; set; }
    }
    /// <summary>
    /// 支付
    /// </summary>
    public class token_order_pay_model {
        /// <summary>
        /// 初始化
        /// </summary>
        public token_order_pay_model() {
            orders = new List<pay_order_model>();
        }
        /// <summary>
        /// 多单商品数据
        /// </summary>
        public List<pay_order_model> orders { get; set; }
        /// <summary>
        /// 合计：总金额
        /// </summary>
        public decimal total_amount { get; set; }
        /// <summary>
        /// 支付类型 0：默认现金支付，1：全红砖兑换，2：红砖+现金,3:红砖商品纯现金购买
        /// </summary>
        public int pay_type { get; set; }
    }
    /// <summary>
    ///订单
    /// </summary>
    public class pay_order_model {
        /// <summary>
        /// 
        /// </summary>
        public pay_order_model() {
            order_items = new List<pay_order_item_model>();
        }
        /// <summary>
        /// 
        /// </summary>
        public List<pay_order_item_model> order_items { get; set; }
        /// <summary>
        /// 留言
        /// </summary>
        public string remark { get; set; }

    }
    /// <summary>
    /// 子订单
    /// </summary>
    public class pay_order_item_model {
        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 商品id
        /// </summary>
        public long product_id { get; set; }
        /// <summary>
        /// 商品skuid
        /// </summary>
        public long sku_id { get; set; }
        /// <summary>
        /// 购买数量
        /// </summary>
        public int quantity { get; set; }
    }

    /// <summary>
    /// 拓垦商城确认订单(缓存对象)
    /// </summary>
    [Serializable]
    public class token_mall_confirm_order_model {
        /// <summary>
        /// 初始化
        /// </summary>
        public token_mall_confirm_order_model() {
            shipping = new Dictionary<long?, shippingaddress_dto>();
        }
        /// <summary>
        /// 待支付订单订单号 
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 分销商品来源店铺id
        /// </summary>
        public long shop_id { get; set; }
        /// <summary>
        /// 购买人Id
        /// </summary>
        public long buy_user_id { get; set; }
        /// <summary>
        /// 产品Id
        /// </summary>
        public long product_id { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public int num { get; set; }
        /// <summary>
        /// 总金额（价格 * 数量 + 邮费）
        /// </summary>
        public decimal total_amount { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal freight { get; set; }
        /// <summary>
        /// 会员收货地址Id
        /// </summary>
        public long? shipping_address_id { get; set; }

        /// <summary>
        /// 分享人商户号
        /// </summary>
        public string share_no { get; set; }

        /// <summary>
        /// 商户号
        /// </summary>
        public string merchant_no { get; set; }
        /// <summary>
        /// 请求方法
        /// </summary>
        public string method { get; set; }
        /// <summary>
        /// 异步通知
        /// </summary>
        public string notify { get; set; }
        /// <summary>
        /// 同步通知
        /// </summary>
        public string front_notify { get; set; }
        /// <summary>
        /// 客户端ip
        /// </summary>
        /// <value>The ip.</value>
        public string ip { get; set; }
        /// <summary>
        /// 微信OpenId
        /// </summary>
        public string wx_open_id { get; set; }
        /// <summary>
        /// 是否跨境商品
        /// </summary>
        public bool is_seas { get; set; }
        /// <summary>
        /// 是否398开通创客商品
        /// </summary>
        public bool is_maker { get; set; }
        /// <summary>
        /// 收货地址
        /// </summary>
        public Dictionary<long?, shippingaddress_dto> shipping { get; set; }
    }

    /// <summary>
    /// 拓垦商城立即支付Model
    /// </summary>
    public class token_mall_to_pay_order_model {
        /// <summary>
        /// 订单号（已存在待支付订单，只传订单号）
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 产品Id
        /// </summary>
        public long product_id { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public int num { get; set; }
        /// <summary>
        /// 总金额
        /// </summary>
        public decimal total_amount { get; set; }
        /// <summary>
        /// 微信OpenId
        /// </summary>
        public string wx_open_id { get; set; }
    }

    /// <summary>
    /// 拓垦商家统计
    /// </summary>
    public class token_merchant_order_count {
        /// <summary>
        /// 待发货订单数量
        /// </summary>
        public int pending_order_num { get; set; }
        /// <summary>
        /// 昨日订单数量
        /// </summary>
        public int yesterday_order_num { get; set; }
        /// <summary>
        /// 昨日交易额
        /// </summary>
        public decimal yesterday_transaction_amount { get; set; }
        /// <summary>
        /// 总收益
        /// </summary>
        public decimal total_transaction_amount { get; set; }

    }
}
